<?php

namespace app\admin\validate;

use think\Validate;

class PhotoValidate extends Validate
{
    protected $rule =   [
        'id' => 'require',
        'type_id' => 'require',
        'photo_id' => 'require',
        'image_url' => 'require',
        'private' => 'require',
        'price' => 'require',
        'name' => 'require',
        'sort' => 'require',
        'introduce' => 'require',
        'cover_id' => 'require',
        'username' => 'require',
        'country' => 'require',
        'institution_id' => 'require',
        'tab_id' => 'require',
        'hor' => 'require',
        'title' => 'require',
        'link' => 'require',
        'remark' => 'require',
    ];

    protected $message = [
        'type_id.require' => '缺少参数type_id',
        'photo_id.require' => '缺少参数photo_id',
        'private.require' => '缺少参数private',
        'price.require' => '缺少参数price',
        'name.require' => '缺少参数name',
        'image_url.require' => '缺少参数image_url',
        'sort.require' => '缺少参数sort',
        'introduce.require' => '缺少参数introduce',
        'cover_id.require' => '缺少参数cover_id',
        'username.require' => '缺少参数username',
        'country.require' => '缺少参数country',
        'institution_id.require' => '缺少参数institution_id',
        'remark.require' => '缺少参数remark',
    ];

    protected $scene = [
        'add' => ['name', 'sort'],
        'listadd' => ['name', 'type_id', 'private', 'price', 'sort'],
        'addimage' => ['photo_id', 'image_url'],
        'addinstitution' => ['name', 'introduce', 'sort'],
        'addUser' => ['username', 'institution_id', 'country', 'sort'],
        'addHelpTab' => ['name', 'sort'],
        'addHelp' => ['tab_id', 'hor', 'title', 'link', 'sort'],
        'addMenu' => ['photo_id', 'name', 'sort'],
    ];
}